<h2>Projects</h2>
<% if @projects.size == 0 %>
No projects. To add a project, fill the following form and click save.<br>
<br>
<%else%>
<table class="tasks">
<tr>
<td>Dashboard</td>
<td></td>
<td></td>
<td>Users</td>
<td>Tasks</td>
<td>% done</td>
</tr>


<% for @project in @projects %>
<tr id="tr<%=@project.id%>">
<td><%= link_to(@project.name, :action=> :view, :id=>@project) %></td>
<td><%= link_to('Edit', :action=> :edit, :id=>@project) %></td>
<td><%= link_to('Tasks',:controller=>:task, :action=>:index, :id => @project) %></td>
<td><%= @project.users.size %></td>
<td><%= @project.tasks.size %></td>
<td bgcolor="#EEE"><%p = @project.progress%><img src="/images/bodybg.gif" height="18" width="<%=p%>"></td>
<td><%= p %>%</td>

<!--<td><%= link_to_remote(image_tag("delete-page-red.gif", :border => 0), :complete => "eval(request.responseText)",  :url => {:action => :delete, :id => @project.id}, :confirm => "Delete this project ?") %></td>-->
</tr>
<% end %>

<% end %>

</table>

<h3>New project</h3>
<% form_tag :action=> :add do %>
<table class="tasks">
<tr><td>Name</td><td><%= text_field(:new, :name, :size => 20, :class => "new") %></td></tr>
<tr><td>&nbsp;</td><td><input class="button" type="submit" value="Save"></td></tr>
</table>
<% end %>

